home *** CD-ROM | disk | FTP | other *** search
- Path: news.umbc.edu!not-for-mail
- From: schlein@umbc.edu (Jonas J. Schlein)
- Newsgroups: comp.lang.c
- Subject: Re: HELP - why isn't ld working
- Date: 3 Feb 1996 16:36:11 -0500
- Organization: University of Maryland Baltimore County
- Message-ID: <4f0kgb$6gj@umbc9.umbc.edu>
- References: <4etai7$22s@deadbird.db.erau.edu>
- NNTP-Posting-Host: umbc9.umbc.edu
- NNTP-Posting-User: schlein
-
- Darryl E. Marsee <marseed@news.db.erau.edu> wrote:
- |> Greetings. Got a user with the following problem:
- |> He has two source files, called ex5.c:
-
- <snip>
-
- |> and ex5a.c:
-
- <snip>
-
- |> if he does the following:
- |>
- |> gcc ex5.c ex5a.c
- |>
- |> It produces a correctly executing a.out. So far so good.
- |>
- |> Again under all three operating systems, if he does the following instead:
- |>
- |> gcc -c ex5.c
- |> gcc -c ex5a.c
- |>
- |> Everything compiles fine. However, if he then tries to link them to
- |> produce an executable with the following:
- |>
- |> ld ex5.o ex5a.o -lc
-
- Tell him don't do that ;-). Either stick with the first way or instead of
- using ld use gcc with the command line:
-
- gcc ex5.o ex5a.o
-
- You can add the -lc, but it's probably not necessary.
- --
- "If it wasn't for C, we would be using BASI, PASAL, and OBOL."
-
- Jonas J. Schlein (schlein@gl.umbc.edu)
-